/*
 * Copyright (c) 2017. All  rights reserved.
 * 项目名：microservice-base
 * 文件名：SysTreeview.java
 * Date  ：17-12-14 下午3:03
 * Author：abin
 *
 */

package com.microservice.base.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * 通用树
 *
 * @author abin
 * @email chcbup@163.com
 * @date 2017-09-26 12:06:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysTreeview implements Serializable {
    private static final long serialVersionUID = 5930549031926023971L;

    //主键
    @Length(min = 0, max = 36)
    private String id;
    //学校编码
    @NotEmpty
    private String schoolCode;
    //所属类别 对应的tv_type c-m (collage-major)
    @Length(min = 0, max = 36)
    private String tvCategory;
    //树类型g-c年级班级 g-t年级教学班s-o校园组织s-t校园社团s-d学校部门c-m学院专业
    @NotEmpty
    private String tvType;
    //类型中文名称
    @Length(min = 0, max = 20)
    private String tvName;
    //顶级:root，其他为父级节点ID
    @NotEmpty
    private String tvParentid;
    //tv_type是g-c或g-t值为grade或class|||s-o s-t s-d
    @Length(min = 0, max = 20)
    private String itemType;
    //树的节点代码
    @Length(min = 0, max = 20)
    private String itemCode;
    //树的名称
    @Length(min = 0, max = 50)
    private String itemName;
    //‘0’：允许添加子节点。‘1’：不允许添加节点 当item-type是class org team depart 必须为1
    @Length(min = 0, max = 1)
    private String itemChild;
    //节点值
    private Integer itemValue;
    //grade升级到的newgrade的ID
    @Length(min = 0, max = 36)
    private String upgradeId;
    //节点内的排序序号
    private Integer itemSort;
    //停用0|当前在用1|历史数据2|逻辑删除-9
    @Length(min = 0, max = 10)
    private String status;
    @Length(min = 0, max = 36)
    private String deleted;
    //备注
    @Length(min = 0, max = 255)
    private String remarks;
    //创建者
    private String createUser;

    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    //更新人
    private String updateUser;

    //更新时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    //同步标志位
    @Length(min = 0, max = 10)
    private String syncFlag;

}
